#!/usr/bin/env node

//实现服务端
//解析请求 然后将响应的数据返回
const http=require('http');



http.createServer((req,res)=>{
  console.log(`${req.method} ${req.url} http:${req.httpVersion}`);

  console.log(req.headers);

  //将请求体打印出来
  req.pipe(process.stdout);
  res.end('ok');
}).listen(8080);
